package com.longjianghuasheng.logistics.util;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.blankj.utilcode.util.SizeUtils;
import com.xuexiang.xui.widget.popupwindow.popup.XUISimplePopup;

public class PopUtils {

    public static void showPop(TextView textView, OnPopSelectClickListener listener) {

        Context context = textView.getContext();
        XUISimplePopup popup = new XUISimplePopup(context, new String[]{"全部", "待审核", "待开始", "已开始"})
                .create(SizeUtils.dp2px(170.0F), (adapter, item, position) -> listener.onClick(position, item.getTitle().toString()))
                .setHasDivider(true);

        popup.showDown(textView);

    }

    public static interface OnPopSelectClickListener {

        void onClick(int position, String str);
    }

}
